package com.wy.tranFile.util;

import java.time.LocalDateTime;

/**
 * @author 吴宇~
 * @motto 我亦无他，唯手熟尔。
 * @edition jdk1.8
 * @reflection 0-1 喧闹任其喧闹，自由我自为之，我自风情万种，与世无争。
 * @date 2024/06/29/15:14
 * @target 心若有所向往，何惧道阻且长
 */
public class TimeUtil {
    public static String getCurrentTimePath() {
        LocalDateTime now = LocalDateTime.now();
        // 获取年、月、日、时、分、秒
        int year = now.getYear();
        int month = now.getMonthValue();
        int day = now.getDayOfMonth();
        return year + "\\" + month + "\\" + day + "\\";
    }

    public static String getCurrentYear() {
        LocalDateTime now = LocalDateTime.now();
        // 获取年、月、日、时、分、秒
        int year = now.getYear();
        return year + "";
    }

    public static String getCurrentMonth() {
        LocalDateTime now = LocalDateTime.now();
        // 获取年、月、日、时、分、秒
        int month = now.getMonthValue();
        return month + "";
    }

    public static String getDayOfMonth() {
        LocalDateTime now = LocalDateTime.now();
        // 获取年、月、日、时、分、秒
        int dayOfMonth = now.getDayOfMonth();
        return dayOfMonth + "";
    }

}
